<template><div><p><code v-pre>more</code> git命令</p>
<!-- more -->
<h2 id="代理" tabindex="-1"><a class="header-anchor" href="#代理" aria-hidden="true">#</a> 代理</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>#使用http代理 
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
#使用socks5代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080


#使用socks5代理（推荐）
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#使用http代理（不推荐）
git config --global http.https://github.com.proxy http://127.0.0.1:1080
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="取消代理" tabindex="-1"><a class="header-anchor" href="#取消代理" aria-hidden="true">#</a> 取消代理</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git config --global --unset http.proxy
git config --global --unset https.proxy
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="克隆项目" tabindex="-1"><a class="header-anchor" href="#克隆项目" aria-hidden="true">#</a> 克隆项目</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git clone https://github.com/qq547176052/qq547176052.git
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="在命令行上创建一个新的仓库" tabindex="-1"><a class="header-anchor" href="#在命令行上创建一个新的仓库" aria-hidden="true">#</a> 在命令行上创建一个新的仓库</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>echo "# 547176052" >> README.md
git init
git add README.md
git commit -m "1.0.0"

git remote add origin https://github.com/qq547176052/qq547176052.git
git branch -M master
设置分支
git push --set-upstream origin master
git push -u origin master
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="推送现有的仓库" tabindex="-1"><a class="header-anchor" href="#推送现有的仓库" aria-hidden="true">#</a> 推送现有的仓库</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git add .
git commit -m "1.0.1"
git push -u origin master
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="强制推送" tabindex="-1"><a class="header-anchor" href="#强制推送" aria-hidden="true">#</a> 强制推送</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git push -f origin master
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="查看当前仓库地址" tabindex="-1"><a class="header-anchor" href="#查看当前仓库地址" aria-hidden="true">#</a> 查看当前仓库地址</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git remote show origin

</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="设置新的仓库地址" tabindex="-1"><a class="header-anchor" href="#设置新的仓库地址" aria-hidden="true">#</a> 设置新的仓库地址</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git remote set-url origin https://github.com/qq547176052/547176052.git

git remote add origin https://github.com/qq547176052/547176052.git
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="本地项目恢复到指定版本" tabindex="-1"><a class="header-anchor" href="#本地项目恢复到指定版本" aria-hidden="true">#</a> 本地项目恢复到指定版本</h2>
<div class="language-text ext-text line-numbers-mode"><pre v-pre class="language-text"><code>git reset --hard b2232b89cbd104f13a2fdd601fa58931ddeab1fd
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></div></template>
